/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;

namespace DaveSexton.DocProject.Sandcastle.TopicManagement
{
	public sealed class ConceptualTemplate
	{
		#region Public Properties
		public string Name
		{
			get
			{
				return name;
			}
		}

		public string FullPath
		{
			get
			{
				return fullPath;
			}
		}
		#endregion

		#region Private / Protected
		private readonly string fullPath, name;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="ConceptualTemplate" /> class.
		/// </summary>
		public ConceptualTemplate(string path)
		{
			if (string.IsNullOrEmpty(path))
				throw new ArgumentException(Resources.Errors.NullOrEmpty, "path");

			fullPath = path;
			name = Path.GetFileNameWithoutExtension(path);
		}

		/// <summary>
		/// Constructs a new instance of the <see cref="ConceptualTemplate" /> class.
		/// </summary>
		public ConceptualTemplate(string basePath, string relativePath)
		{
			if (string.IsNullOrEmpty(basePath))
				throw new ArgumentException(Resources.Errors.NullOrEmpty, "basePath");

			if (string.IsNullOrEmpty(relativePath))
				throw new ArgumentException(Resources.Errors.NullOrEmpty, "relativePath");

			fullPath = Path.Combine(basePath, relativePath);
			name = Path.GetFileNameWithoutExtension(relativePath);
		}
		#endregion

		#region Methods
		public override string ToString()
		{
			return name;
		}
		#endregion
	}
}
